//在页面未加载完毕之前显示的loading Html自定义内容
var _LoadingHtml = '<div id="loading"><span class="loading-icon"></span><h3 class="loading-text">Loading ...</h3></div>';
//呈现loading效果
document.write(_LoadingHtml);

//监听加载状态改变
document.onreadystatechange = completeLoading;

//加载状态为complete时移除loading效果
function completeLoading() {
    if (document.readyState == "complete") {
        var loadingMask = document.getElementById('loading');
        var content = document.getElementById('content');
        setTimeout(() => {
            loadingMask.parentNode.removeChild(loadingMask);
            content.style.display="";
        }, 500);
    }
}